package com.yidu.best.stock.stockTrade.domain;

import java.math.BigDecimal;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;
/**
 * 股票交易数据实体类
 * @author QQ
 * @since 2019/12/19
 */
public class StockTrade {
	/**
	 * 股票交易Id
	 */
	private String stockTradeId;
	/**
	 * 股票交易编号
	 */
	private String stockTradeNo;
	/**
	 * 基金Id
	 */
	private String fundId;
	/**
	 * 基金代码
	 */
	private String fundCode;
	/**
	 * 基金名
	 */
	private String fundName;
	/**
	 * 股票代码
	 */
	private String	stockId;
	/**
	 * 股票代码
	 */
	private String stockCode;
	/**
	 * 股票名
	 */
	private String stockName;
	/**
	 * 基金经理Id
	 */
	private String userId;
	/**
	 * 基金经理名
	 */
	private String userName;
	/**
	 * 券商Id
	 */
	private String brokerId;
	/**
	 * 券商名
	 */
	private String brokerName;
	private String seatId;
	
	private String seatName;
	
	/**
	 * 交易方式
	 * 1：买入、2：卖出、3：分红、4：派股
	 */
	private Integer tradeInOrOut;
	/**
	 * 交易标识
	 * 1：流入、2：流出
	 */
	private Integer tradeFlag;
	/**
	 * 交易价格
	 */
	private BigDecimal tradePrice;
	/**
	 * 交易日期
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date tradeDate;
	/**
	 * 交易数量(份)
	 */
	private Integer share;
	/**
	 * 交易额(总)
	 */
	private BigDecimal turnover;
	/**
	 * 印花税(印花税*交易额)
	 */
	private BigDecimal stampTax;
	/**
	 * 征管费
	 */
	private BigDecimal managementFees;
	/**
	 * 过户费(交易所)
	 */
	private BigDecimal transferFee;
	/**
	 * 佣金费用(券商)
	 */
	private BigDecimal commission;
	/**
	 * 经手费(交易所)
	 */
	private BigDecimal brokerage;
	/**
	 * 总金额
	 */
	private BigDecimal total;
	/**
	 * 证券利息(股息|券息)
	 */
	private BigDecimal securityInterest;
	/**
	 * 交易状态
	 * 1:已结算、0:未结算
	 */
	private Integer tradeStatus;
	public StockTrade() {
	}
	public StockTrade(String stockTradeId, String stockTradeNo, String fundId, String fundCode, String fundName,
			String stockId, String stockCode, String stockName, String userId, String userName, String brokerId,
			String brokerName, String seatId, String seatName, Integer tradeInOrOut, Integer tradeFlag,
			BigDecimal tradePrice, Date tradeDate, Integer share, BigDecimal turnover, BigDecimal stampTax,
			BigDecimal managementFees, BigDecimal transferFee, BigDecimal commission, BigDecimal brokerage,
			BigDecimal total, BigDecimal securityInterest, Integer tradeStatus) {
		super();
		this.stockTradeId = stockTradeId;
		this.stockTradeNo = stockTradeNo;
		this.fundId = fundId;
		this.fundCode = fundCode;
		this.fundName = fundName;
		this.stockId = stockId;
		this.stockCode = stockCode;
		this.stockName = stockName;
		this.userId = userId;
		this.userName = userName;
		this.brokerId = brokerId;
		this.brokerName = brokerName;
		this.seatId = seatId;
		this.seatName = seatName;
		this.tradeInOrOut = tradeInOrOut;
		this.tradeFlag = tradeFlag;
		this.tradePrice = tradePrice;
		this.tradeDate = tradeDate;
		this.share = share;
		this.turnover = turnover;
		this.stampTax = stampTax;
		this.managementFees = managementFees;
		this.transferFee = transferFee;
		this.commission = commission;
		this.brokerage = brokerage;
		this.total = total;
		this.securityInterest = securityInterest;
		this.tradeStatus = tradeStatus;
	}
	public String getStockTradeId() {
		return stockTradeId;
	}
	public void setStockTradeId(String stockTradeId) {
		this.stockTradeId = stockTradeId;
	}
	public String getStockTradeNo() {
		return stockTradeNo;
	}
	public void setStockTradeNo(String stockTradeNo) {
		this.stockTradeNo = stockTradeNo;
	}
	public String getFundId() {
		return fundId;
	}
	public void setFundId(String fundId) {
		this.fundId = fundId;
	}
	public String getFundCode() {
		return fundCode;
	}
	public void setFundCode(String fundCode) {
		this.fundCode = fundCode;
	}
	public String getFundName() {
		return fundName;
	}
	public void setFundName(String fundName) {
		this.fundName = fundName;
	}
	public String getStockId() {
		return stockId;
	}
	public void setStockId(String stockId) {
		this.stockId = stockId;
	}
	public String getStockCode() {
		return stockCode;
	}
	public void setStockCode(String stockCode) {
		this.stockCode = stockCode;
	}
	public String getStockName() {
		return stockName;
	}
	public void setStockName(String stockName) {
		this.stockName = stockName;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getBrokerId() {
		return brokerId;
	}
	public void setBrokerId(String brokerId) {
		this.brokerId = brokerId;
	}
	public String getBrokerName() {
		return brokerName;
	}
	public void setBrokerName(String brokerName) {
		this.brokerName = brokerName;
	}
	public String getSeatId() {
		return seatId;
	}
	public void setSeatId(String seatId) {
		this.seatId = seatId;
	}
	public String getSeatName() {
		return seatName;
	}
	public void setSeatName(String seatName) {
		this.seatName = seatName;
	}
	public Integer getTradeInOrOut() {
		return tradeInOrOut;
	}
	public void setTradeInOrOut(Integer tradeInOrOut) {
		this.tradeInOrOut = tradeInOrOut;
	}
	public Integer getTradeFlag() {
		return tradeFlag;
	}
	public void setTradeFlag(Integer tradeFlag) {
		this.tradeFlag = tradeFlag;
	}
	public BigDecimal getTradePrice() {
		return tradePrice;
	}
	public void setTradePrice(BigDecimal tradePrice) {
		this.tradePrice = tradePrice;
	}
	public Date getTradeDate() {
		return tradeDate;
	}
	public void setTradeDate(Date tradeDate) {
		this.tradeDate = tradeDate;
	}
	public Integer getShare() {
		return share;
	}
	public void setShare(Integer share) {
		this.share = share;
	}
	public BigDecimal getTurnover() {
		return turnover;
	}
	public void setTurnover(BigDecimal turnover) {
		this.turnover = turnover;
	}
	public BigDecimal getStampTax() {
		return stampTax;
	}
	public void setStampTax(BigDecimal stampTax) {
		this.stampTax = stampTax;
	}
	public BigDecimal getManagementFees() {
		return managementFees;
	}
	public void setManagementFees(BigDecimal managementFees) {
		this.managementFees = managementFees;
	}
	public BigDecimal getTransferFee() {
		return transferFee;
	}
	public void setTransferFee(BigDecimal transferFee) {
		this.transferFee = transferFee;
	}
	public BigDecimal getCommission() {
		return commission;
	}
	public void setCommission(BigDecimal commission) {
		this.commission = commission;
	}
	public BigDecimal getBrokerage() {
		return brokerage;
	}
	public void setBrokerage(BigDecimal brokerage) {
		this.brokerage = brokerage;
	}
	public BigDecimal getTotal() {
		return total;
	}
	public void setTotal(BigDecimal total) {
		this.total = total;
	}
	public BigDecimal getSecurityInterest() {
		return securityInterest;
	}
	public void setSecurityInterest(BigDecimal securityInterest) {
		this.securityInterest = securityInterest;
	}
	public Integer getTradeStatus() {
		return tradeStatus;
	}
	public void setTradeStatus(Integer tradeStatus) {
		this.tradeStatus = tradeStatus;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((brokerId == null) ? 0 : brokerId.hashCode());
		result = prime * result + ((brokerName == null) ? 0 : brokerName.hashCode());
		result = prime * result + ((brokerage == null) ? 0 : brokerage.hashCode());
		result = prime * result + ((commission == null) ? 0 : commission.hashCode());
		result = prime * result + ((fundCode == null) ? 0 : fundCode.hashCode());
		result = prime * result + ((fundId == null) ? 0 : fundId.hashCode());
		result = prime * result + ((fundName == null) ? 0 : fundName.hashCode());
		result = prime * result + ((managementFees == null) ? 0 : managementFees.hashCode());
		result = prime * result + ((seatId == null) ? 0 : seatId.hashCode());
		result = prime * result + ((seatName == null) ? 0 : seatName.hashCode());
		result = prime * result + ((securityInterest == null) ? 0 : securityInterest.hashCode());
		result = prime * result + ((share == null) ? 0 : share.hashCode());
		result = prime * result + ((stampTax == null) ? 0 : stampTax.hashCode());
		result = prime * result + ((stockCode == null) ? 0 : stockCode.hashCode());
		result = prime * result + ((stockId == null) ? 0 : stockId.hashCode());
		result = prime * result + ((stockName == null) ? 0 : stockName.hashCode());
		result = prime * result + ((stockTradeId == null) ? 0 : stockTradeId.hashCode());
		result = prime * result + ((stockTradeNo == null) ? 0 : stockTradeNo.hashCode());
		result = prime * result + ((total == null) ? 0 : total.hashCode());
		result = prime * result + ((tradeDate == null) ? 0 : tradeDate.hashCode());
		result = prime * result + ((tradeFlag == null) ? 0 : tradeFlag.hashCode());
		result = prime * result + ((tradeInOrOut == null) ? 0 : tradeInOrOut.hashCode());
		result = prime * result + ((tradePrice == null) ? 0 : tradePrice.hashCode());
		result = prime * result + ((tradeStatus == null) ? 0 : tradeStatus.hashCode());
		result = prime * result + ((transferFee == null) ? 0 : transferFee.hashCode());
		result = prime * result + ((turnover == null) ? 0 : turnover.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		result = prime * result + ((userName == null) ? 0 : userName.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		StockTrade other = (StockTrade) obj;
		if (brokerId == null) {
			if (other.brokerId != null)
				return false;
		} else if (!brokerId.equals(other.brokerId))
			return false;
		if (brokerName == null) {
			if (other.brokerName != null)
				return false;
		} else if (!brokerName.equals(other.brokerName))
			return false;
		if (brokerage == null) {
			if (other.brokerage != null)
				return false;
		} else if (!brokerage.equals(other.brokerage))
			return false;
		if (commission == null) {
			if (other.commission != null)
				return false;
		} else if (!commission.equals(other.commission))
			return false;
		if (fundCode == null) {
			if (other.fundCode != null)
				return false;
		} else if (!fundCode.equals(other.fundCode))
			return false;
		if (fundId == null) {
			if (other.fundId != null)
				return false;
		} else if (!fundId.equals(other.fundId))
			return false;
		if (fundName == null) {
			if (other.fundName != null)
				return false;
		} else if (!fundName.equals(other.fundName))
			return false;
		if (managementFees == null) {
			if (other.managementFees != null)
				return false;
		} else if (!managementFees.equals(other.managementFees))
			return false;
		if (seatId == null) {
			if (other.seatId != null)
				return false;
		} else if (!seatId.equals(other.seatId))
			return false;
		if (seatName == null) {
			if (other.seatName != null)
				return false;
		} else if (!seatName.equals(other.seatName))
			return false;
		if (securityInterest == null) {
			if (other.securityInterest != null)
				return false;
		} else if (!securityInterest.equals(other.securityInterest))
			return false;
		if (share == null) {
			if (other.share != null)
				return false;
		} else if (!share.equals(other.share))
			return false;
		if (stampTax == null) {
			if (other.stampTax != null)
				return false;
		} else if (!stampTax.equals(other.stampTax))
			return false;
		if (stockCode == null) {
			if (other.stockCode != null)
				return false;
		} else if (!stockCode.equals(other.stockCode))
			return false;
		if (stockId == null) {
			if (other.stockId != null)
				return false;
		} else if (!stockId.equals(other.stockId))
			return false;
		if (stockName == null) {
			if (other.stockName != null)
				return false;
		} else if (!stockName.equals(other.stockName))
			return false;
		if (stockTradeId == null) {
			if (other.stockTradeId != null)
				return false;
		} else if (!stockTradeId.equals(other.stockTradeId))
			return false;
		if (stockTradeNo == null) {
			if (other.stockTradeNo != null)
				return false;
		} else if (!stockTradeNo.equals(other.stockTradeNo))
			return false;
		if (total == null) {
			if (other.total != null)
				return false;
		} else if (!total.equals(other.total))
			return false;
		if (tradeDate == null) {
			if (other.tradeDate != null)
				return false;
		} else if (!tradeDate.equals(other.tradeDate))
			return false;
		if (tradeFlag == null) {
			if (other.tradeFlag != null)
				return false;
		} else if (!tradeFlag.equals(other.tradeFlag))
			return false;
		if (tradeInOrOut == null) {
			if (other.tradeInOrOut != null)
				return false;
		} else if (!tradeInOrOut.equals(other.tradeInOrOut))
			return false;
		if (tradePrice == null) {
			if (other.tradePrice != null)
				return false;
		} else if (!tradePrice.equals(other.tradePrice))
			return false;
		if (tradeStatus == null) {
			if (other.tradeStatus != null)
				return false;
		} else if (!tradeStatus.equals(other.tradeStatus))
			return false;
		if (transferFee == null) {
			if (other.transferFee != null)
				return false;
		} else if (!transferFee.equals(other.transferFee))
			return false;
		if (turnover == null) {
			if (other.turnover != null)
				return false;
		} else if (!turnover.equals(other.turnover))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		if (userName == null) {
			if (other.userName != null)
				return false;
		} else if (!userName.equals(other.userName))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "StockTrade [stockTradeId=" + stockTradeId + ", stockTradeNo=" + stockTradeNo + ", fundId=" + fundId
				+ ", fundCode=" + fundCode + ", fundName=" + fundName + ", stockId=" + stockId + ", stockCode="
				+ stockCode + ", stockName=" + stockName + ", userId=" + userId + ", userName=" + userName
				+ ", brokerId=" + brokerId + ", brokerName=" + brokerName + ", seatId=" + seatId + ", seatName="
				+ seatName + ", tradeInOrOut=" + tradeInOrOut + ", tradeFlag=" + tradeFlag + ", tradePrice="
				+ tradePrice + ", tradeDate=" + tradeDate + ", share=" + share + ", turnover=" + turnover
				+ ", stampTax=" + stampTax + ", managementFees=" + managementFees + ", transferFee=" + transferFee
				+ ", commission=" + commission + ", brokerage=" + brokerage + ", total=" + total + ", securityInterest="
				+ securityInterest + ", tradeStatus=" + tradeStatus + "]";
	}
}
